namespace GeneXus.Programs {
   using System;
   using System.Collections;
   using GeneXus.Utils;
   using GeneXus.Resources;
   using GeneXus.Application;
   using GeneXus.Metadata;
   using com.genexus;
   using com.genexus.ui;
   using com.genexus.uifactory;
   using GeneXus.Windows;
   using System.Data;
   using System.Data.SqlClient;
   using GeneXus.Data;
   using GeneXus.Data.FAT;
   using GeneXus.XML;
   using GeneXus.Encryption;
   using GeneXus.Http.Client;
   public class subwvisprsn40 : GXSubfileElement
   {
      private String PrsCod ;
      private short PrsTlfCod ;
      private int PrsPreTlf ;
      private String PrsNroTlf ;
      private int PrsAnxTlf ;
      private short PrsFlgMov ;
      public String getPrsCod( )
      {
         return PrsCod ;
      }

      public void setPrsCod( String value )
      {
         PrsCod = value;
      }

      public short getPrsTlfCod( )
      {
         return PrsTlfCod ;
      }

      public void setPrsTlfCod( short value )
      {
         PrsTlfCod = value;
      }

      public int getPrsPreTlf( )
      {
         return PrsPreTlf ;
      }

      public void setPrsPreTlf( int value )
      {
         PrsPreTlf = value;
      }

      public String getPrsNroTlf( )
      {
         return PrsNroTlf ;
      }

      public void setPrsNroTlf( String value )
      {
         PrsNroTlf = value;
      }

      public int getPrsAnxTlf( )
      {
         return PrsAnxTlf ;
      }

      public void setPrsAnxTlf( int value )
      {
         PrsAnxTlf = value;
      }

      public short getPrsFlgMov( )
      {
         return PrsFlgMov ;
      }

      public void setPrsFlgMov( short value )
      {
         PrsFlgMov = value;
      }

      public override void clear( )
      {
         PrsCod = "" ;
         PrsTlfCod = 0 ;
         PrsPreTlf = 0 ;
         PrsNroTlf = "" ;
         PrsAnxTlf = 0 ;
         PrsFlgMov = 0 ;
      }

      public override int compareTo( GXSubfileElement element ,
                                     int column )
      {
         switch (column)
         {
               case 0 :
                  return GXutil.strcmp( GXutil.upper( PrsCod ), GXutil.upper( ((subwvisprsn40) element).getPrsCod() ));
               case 1 :
                  if ( PrsTlfCod > ((subwvisprsn40) element).getPrsTlfCod() ) return 1;
                  if ( PrsTlfCod < ((subwvisprsn40) element).getPrsTlfCod() ) return -1;
                  return 0;
               case 2 :
                  if ( PrsPreTlf > ((subwvisprsn40) element).getPrsPreTlf() ) return 1;
                  if ( PrsPreTlf < ((subwvisprsn40) element).getPrsPreTlf() ) return -1;
                  return 0;
               case 3 :
                  return GXutil.strcmp( GXutil.upper( PrsNroTlf ), GXutil.upper( ((subwvisprsn40) element).getPrsNroTlf() ));
               case 4 :
                  if ( PrsAnxTlf > ((subwvisprsn40) element).getPrsAnxTlf() ) return 1;
                  if ( PrsAnxTlf < ((subwvisprsn40) element).getPrsAnxTlf() ) return -1;
                  return 0;
               case 5 :
                  if ( PrsFlgMov > ((subwvisprsn40) element).getPrsFlgMov() ) return 1;
                  if ( PrsFlgMov < ((subwvisprsn40) element).getPrsFlgMov() ) return -1;
                  return 0;
         }
         return 0;
      }

      public override bool isEmpty( )
      {
         return ( ( String.Compare(PrsCod.TrimEnd(' '), "".TrimEnd(' ') ) == 0 ) && ( PrsTlfCod == 0 ) && ( PrsPreTlf == 0 ) && ( String.Compare(PrsNroTlf.TrimEnd(' '), "".TrimEnd(' ') ) == 0 ) && ( PrsAnxTlf == 0 ) && ( PrsFlgMov == 0 ) )  ;
      }

      public override void setColumn( GXComponent cell ,
                                      int field )
      {
         switch (field) {
            case 0 :
               cell.setValue( PrsCod );
               break;
            case 1 :
               cell.setValue( PrsTlfCod );
               break;
            case 2 :
               cell.setValue( PrsPreTlf );
               break;
            case 3 :
               cell.setValue( PrsNroTlf );
               break;
            case 4 :
               cell.setValue( PrsAnxTlf );
               break;
            case 5 :
               cell.setValue( PrsFlgMov );
               break;
         }
      }

      public bool isFieldChanged( GXComponent cell ,
                                  int field )
      {
         switch (field) {
            case 0 :
               return ( ( GXutil.strcmp(((GUIObjectString) cell).getValue(),PrsCod) == 0) );
            case 1 :
               return ( (((GUIObjectShort) cell).getValue() == PrsTlfCod) );
            case 2 :
               return ( (((GUIObjectInt) cell).getValue() == PrsPreTlf) );
            case 3 :
               return ( ( GXutil.strcmp(((GUIObjectString) cell).getValue(),PrsNroTlf) == 0) );
            case 4 :
               return ( (((GUIObjectInt) cell).getValue() == PrsAnxTlf) );
            case 5 :
               return ( (((GUIObjectShort) cell).getValue() == PrsFlgMov) );
         }
         return false;
      }

      public override void setField( int i ,
                                     GXComponent value )
      {
         switch (i)
         {
               case 0 :
                  PrsCod = value.getStringValue() ;
                  break;
               case 1 :
                  PrsTlfCod = value.getShortValue() ;
                  break;
               case 2 :
                  PrsPreTlf = value.getIntValue() ;
                  break;
               case 3 :
                  PrsNroTlf = value.getStringValue() ;
                  break;
               case 4 :
                  PrsAnxTlf = value.getIntValue() ;
                  break;
               case 5 :
                  PrsFlgMov = value.getShortValue() ;
                  break;
         }
      }

      public override void setField( int i ,
                                     GXSubfileElement element )
      {
         switch (i)
         {
               case 0 :
                  PrsCod = ((subwvisprsn40) element).PrsCod;
                  return;
               case 1 :
                  PrsTlfCod = ((subwvisprsn40) element).PrsTlfCod;
                  return;
               case 2 :
                  PrsPreTlf = ((subwvisprsn40) element).PrsPreTlf;
                  return;
               case 3 :
                  PrsNroTlf = ((subwvisprsn40) element).PrsNroTlf;
                  return;
               case 4 :
                  PrsAnxTlf = ((subwvisprsn40) element).PrsAnxTlf;
                  return;
               case 5 :
                  PrsFlgMov = ((subwvisprsn40) element).PrsFlgMov;
                  return;
         }
      }

   }

}
